import service from '@/utils/crmRequest'

export default () => ({
  // 编号规则列表
  CODEROLE_LIST: () => {
    return service({
      url: '/api/sysSequence/list',
      method: 'get',
    })
  },
  // 更新编号规则
  CODEROLE_UPDATE: (data) => {
    return service({
      url: '/api/sysSequence/save',
      method: 'post',
      data
    })
  },
  // 营销区域添加
  SELLAREA_CREATE: (data) => {
    return service({
      url: '/api/sysSalesArea/create',
      method: 'post',
      data
    })
  },
  // 营销区域编辑
  SELLAREA_UPDATE: (data) => {
    return service({
      url: '/api/sysSalesArea/update',
      method: 'put',
      data
    })
  },
  // 营销区域删除
  SELLAREA_DELETE: (id) => {
    return service({
      url: '/api/sysSalesArea/delete?id=' + id,
      method: 'delete',
    })
  },
  // 营销区域详情
  SELLAREA_DETAIL: (id) => {
    return service({
      url: '/api/sysSalesArea/detail?id=' + id,
      method: 'get',
    })
  },
  // 营销区域列表
  SELLAREA_LIST: () => {
    return service({
      url: '/api/sysSalesArea/tree',
      method: 'get',
    })
  },

  // 营销区域下拉地区
  SELLAREA_SELECT_AREA: (params) => {
    return service({
      url: 'api/sysSalesArea/select',
      method: 'get',
      params
    })
  },

  // 生产线列表
  PRODUCTLINE_LIST: (data) => {
    return service({
      url: '/api/sysProductLine/list',
      method: 'post',
      data
    })
  },
  // 生产线详情
  PRODUCTLINE_DETAIL: (id) => {
    return service({
      url: '/api/sysProductLine/detail?id=' + id,
      method: 'get',
    })
  },
  // 营销区域添加
  PRODUCTLINE_CREATE: (data) => {
    return service({
      url: '/api/sysProductLine/create',
      method: 'post',
      data
    })
  },
  // 营销区域编辑
  PRODUCTLINE_UPDATE: (data) => {
    return service({
      url: '/api/sysProductLine/update',
      method: 'put',
      data
    })
  },
  // 营销区域删除
  PRODUCTLINE_DELETE: (id) => {
    return service({
      url: '/api/sysProductLine/delete?id=' + id,
      method: 'delete',
    })
  },
  // 获取部门树
  SYSDEPT_TREE: (id) => {
    return service({
      url: 'api/sysDept/tree',
      method: 'get',
    })
  },

  // 获取部门下用户
  SYSDEPT_USER: (id) => {
    return service({
      url: 'api/sysUser/dept?deptId=' + id,
      method: 'get',
    })
  },
})

